package mtest.structure;

public class Demo6 {
    public static void main(String[] args) {
        int i = 0;
        int sum = 0;
        //先执行，后判断
        do {
            sum += i;
            i++;
            System.out.println("do--while");
        } while (i < 0);
        //     System.out.println(sum); //5050
        System.out.println("------------------------------");
        // 先判断，后执行
        while (i < 0) {
            sum += i;
            System.out.println("while");
        }
    }
}
